<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); global $template; ?>
<script type="text/javascript">controller = '<?php echo $this->data['controller_name']; ?>'; action = '<?php echo $this->data['action_name']; ?>'; beforeSubmit = gs_beforeSubmit; afterSubmit = gs_afterSubmit;  submitGridData = gs_submitGridData; deleteData = gs_deleteData; approveData = gs_approveData; rejectData = gs_rejectData; gs_permission_c = '<?php echo (defined('PERMISSION_C') ? PERMISSION_C :''); ?>'; gs_permission_r = '<?php echo (defined('PERMISSION_R') ? PERMISSION_R :''); ?>'; gs_permission_u = '<?php echo (defined('PERMISSION_U') ? PERMISSION_U :''); ?>'; gs_permission_d = '<?php echo (defined('PERMISSION_D') ? PERMISSION_D :''); ?>'; gs_permission_pr = '<?php echo (defined('PERMISSION_PR') ? PERMISSION_PR :''); ?>'; gs_permission_dw = '<?php echo (defined('PERMISSION_DW') ? PERMISSION_DW :''); ?>'; gs_permission_up = '<?php echo (defined('PERMISSION_UP') ? PERMISSION_UP :''); ?>';</script>
<?php 
	$is_popup = (intval(post("popup"))==1);
	if (!$is_popup) { ?>
<div class="content_box">
    <!-- Head : Title -->
    <div class="head">
        <div class="tl"><?php if(isset($title_for_layout)) echo $title_for_layout; ?></div>
        <div class="tr"><div class="button_set" id="action_bar"></div>&nbsp;</div>
    </div>
    
    <div class="content"><?php } ?>
        <form id="<?php echo ($is_popup ? "form_popup" : "form_master") ?>" target="if_submit" method="post" enctype="multipart/form-data"><?php if(isset($content_for_layout)) echo $content_for_layout; ?><input type="submit" style="display:none;" /></form>
<?php
	if (!$is_popup) { ?></div>
    
    <!-- Footer -->
    <div class="foot" style="border-top:none">
        <div class="bl">&nbsp;<div class="debug_url" style="display:none;margin:-15px 0px 0px 0px;"><img src="<?php echo base_url(); ?>content/images/load.png" alt="" border="0" onclick="loadPage('<?php echo '/'.$this->data['controller_name'] . '/' . $this->data['action_name'] . '/' .(trim($_SERVER['QUERY_STRING'])=='' ? '' : '?') . $_SERVER['QUERY_STRING']; ?>');" title="Reload This Page" style="cursor:pointer;margin-right:10px;" />  <?php echo '/'.$this->data['controller_name'] . '/' . $this->data['action_name'] . '/' . (trim($_SERVER['QUERY_STRING'])=='' ? '' : '?') . $_SERVER['QUERY_STRING']; ?></div></div>
        <div class="br">&nbsp;</div>
    </div>
</div><?php }else if(isset($title)){ ?><script type="text/javascript">$('#form_popup').parent().parent().parent().prev().find('.panel-title').html('<?php echo addslashes($title); ?>');</script><?php } ?>